import request from '@/utils/request'

// 考生管理
export const getAdmissionList = (params) => {
  return request({
    url: '/system/admission/list',
    method: 'get',
    params
  })
}

// 考生清空
export const removeAdmissionList = (params) => {
  return request({
    url: '/system/admission/remove',
    method: 'delete',
    params
  })
}

// 考生删除
export const deleteAdmissionList = (params) => {
  return request({
    url: '/system/admission/delete',
    method: 'delete',
    params
  })
}



// 文章列表
export const getArticleList = (params) => {
  return request({
    url: '/system/data/list',
    method: 'get',
    params
  })
}

// 文章删除
export const deleteArticleList = (id) => {
  return request({
    url: '/system/data/' + id,
    method: 'delete',
  })
}

// 文章新增
export const newArticleList = (params) => {
  return request({
    url: '/system/data',
    method: 'post',
    data: params
  })
}

// 文章编辑
export const editArticleList = (params) => {
  return request({
    url: '/system/data',
    method: 'put',
    data: params
  })
}

// 导入
export function importFile(url, data) {
  return new Promise((resolve) => {
    request({
      url: url,
      method: "post",
      contentType: "multipart/form-data",
      data: data,
    })
      .then((res) => {
        resolve(res);
      })
      .catch(() => {});
  });
}
